package com.ttbj.task;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;

import com.ttbj.ftp.client.FTPClientHelper;
import com.ttbj.ftp.constant.FtpConstant;
import com.zywl.common.utils.DateUtils;

/**
 * 任务
 * 由石英框架调度
 * 每晚23点删除三天前的订单图片文件夹
 * 
 */
public class OrderImageTask {
	
	@Autowired
	FTPClientHelper fTPClientHelper = null;
	public void remove() throws Exception{
		Date previousNDate = DateUtils.getPreviousNDate(new Date(), 3);
		String date = DateUtils.getDate2SStr2(previousNDate);
		fTPClientHelper.removeDir(FtpConstant.BASE_URL+ FtpConstant.ORDER_URL +date);
	}
	

}
